package com.dalin.platform.glb.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/*****************************************************************************
 * @content: 类信息                                                                                                                                *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2012-04-12 19:00:46                                            *
 * @modDate: 2012-04-12 19:00:46                                            *
 * @version: 1.00                                                           *
 ****************************************************************************/
@Entity
@Table(name="GLB_ATTACHMENT")
public class GlbAttachmentEntity extends com.dalin.common.base.BaseObject {
	private Long attachmentId; // ATTACHMENT_ID,16,0,null
	private Long projectId;
	private String bizType;
    private String bizDesc1; // ATTACHMENT_DESC,1024,0,null
    private String bizDesc2; // ATTACHMENT_DESC,1024,0,null
    private String bizDesc3; // ATTACHMENT_DESC,1024,0,null
    private String bizDesc4; // ATTACHMENT_DESC,1024,0,null
    private Integer attachmentPaperNum; // ATTACHMENT_PAPER_NUM,8,0,null
    private String attachmentType; // ATTACHMENT_TYPE,64,0,null
    private Long attachmentSize; // ATTACHMENT_SIZE,8,0,null
    private Integer orderNumber; // ORDER_NUMBER,8,0,null
    private String attachmentName; // ATTACHMENT_NAME,512,0,null
    private String attachmentSavedName; // ATTACHMENT_PATH,1024,0,null
    private String attachmentSavedDir; // ATTACHMENT_PATH,1024,0,null
    private Long createUserId; // CREATE_USER_ID,16,0,null
    private Date createDate; // CREATE_DATE,7,0,null
    private Long groupId; // GROUP_ID,16,0,null
    private String createUserName; // CREATE_USER_NAME,128,0,null



   @Column(name="BIZ_DESC1")
    public String getBizDesc1() {
        return bizDesc1;
    }

    public void setBizDesc1(String bizDesc1) {
        this.bizDesc1 = bizDesc1;
    }

    @Column(name="BIZ_DESC2")
    public String getBizDesc2() {
        return bizDesc2;
    }

    public void setBizDesc2(String bizDesc2) {
        this.bizDesc2 = bizDesc2;
    }

    @Column(name="BIZ_DESC3")
    public String getBizDesc3() {
		return bizDesc3;
	}

	public void setBizDesc3(String bizDesc3) {
		this.bizDesc3 = bizDesc3;
	}

	@Column(name="BIZ_DESC4")
	public String getBizDesc4() {
		return bizDesc4;
	}

	public void setBizDesc4(String bizDesc4) {
		this.bizDesc4 = bizDesc4;
	}

	@Id
    @Column(name="ATTACHMENT_ID")
    @GeneratedValue(strategy = GenerationType.TABLE,generator="generator_normal")
    @TableGenerator(
        name = "generator_normal",
        table = "GLB_GENERATOR_KEY",
        pkColumnName = "GEN_KEY",
        valueColumnName = "GEN_VALUE",
        pkColumnValue = "GLB_ATTACHMENT",
        allocationSize=1
    )
    public Long getAttachmentId() {
        return attachmentId;
    }

    public void setAttachmentId(Long attachmentId) {
        this.attachmentId = attachmentId;
    }

    @Column(name="BIZ_TYPE")
    public String getBizType() {
		return bizType;
	}

	public void setBizType(String bizType) {
		this.bizType = bizType;
	}

	@Column(name="ATTACHMENT_PAPER_NUM")
    public Integer getAttachmentPaperNum() {
        return attachmentPaperNum;
    }

    public void setAttachmentPaperNum(Integer attachmentPaperNum) {
        this.attachmentPaperNum = attachmentPaperNum;
    }

    @Column(name="ATTACHMENT_TYPE")
    public String getAttachmentType() {
        return attachmentType;
    }

    public void setAttachmentType(String attachmentType) {
        this.attachmentType = attachmentType;
    }

    @Column(name="ATTACHMENT_SIZE")
    public Long getAttachmentSize() {
        return attachmentSize;
    }

    public void setAttachmentSize(Long attachmentSize) {
        this.attachmentSize = attachmentSize;
    }

    @Column(name="ORDER_NUMBER")
    public Integer getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(Integer orderNumber) {
        this.orderNumber = orderNumber;
    }

    @Column(name="ATTACHMENT_NAME")
    public String getAttachmentName() {
        return attachmentName;
    }

    public void setAttachmentName(String attachmentName) {
        this.attachmentName = attachmentName;
    }

    @Column(name="ATTACHMENT_SAVED_DIR")
    public String getAttachmentSavedDir() {
		return attachmentSavedDir;
	}

	public void setAttachmentSavedDir(String attachmentSavedDir) {
		this.attachmentSavedDir = attachmentSavedDir;
	}

    @Column(name="CREATE_USER_ID")
    public Long getCreateUserId() {
        return createUserId;
    }

    @Column(name="ATTACHMENT_SAVED_NAME")
    public String getAttachmentSavedName() {
		return attachmentSavedName;
	}

	public void setAttachmentSavedName(String attachmentSavedName) {
		this.attachmentSavedName = attachmentSavedName;
	}

	

	public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="CREATE_DATE")
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Column(name="GROUP_ID")
    public Long getGroupId() {
        return groupId;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    @Column(name="CREATE_USER_NAME")
    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    
    
    @Column(name="PROJECT_ID")
    public Long getProjectId() {
		return projectId;
	}

	public void setProjectId(Long projectId) {
		this.projectId = projectId;
	}

	@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof GlbAttachmentEntity)) return false;
        final GlbAttachmentEntity other = (GlbAttachmentEntity) o;
        if (attachmentId == null) {
            if (other.attachmentId != null) return false;
        } else if (!attachmentId.equals(other.attachmentId)) {
            return false;
        }
        if (attachmentPaperNum == null) {
            if (other.attachmentPaperNum != null) return false;
        } else if (!attachmentPaperNum.equals(other.attachmentPaperNum)) {
            return false;
        }
        if (attachmentType == null) {
            if (other.attachmentType != null) return false;
        } else if (!attachmentType.equals(other.attachmentType)) {
            return false;
        }
        if (attachmentSize == null) {
            if (other.attachmentSize != null) return false;
        } else if (!attachmentSize.equals(other.attachmentSize)) {
            return false;
        }
        if (orderNumber == null) {
            if (other.orderNumber != null) return false;
        } else if (!orderNumber.equals(other.orderNumber)) {
            return false;
        }
        if (attachmentName == null) {
            if (other.attachmentName != null) return false;
        } else if (!attachmentName.equals(other.attachmentName)) {
            return false;
        }
        if (createUserId == null) {
            if (other.createUserId != null) return false;
        } else if (!createUserId.equals(other.createUserId)) {
            return false;
        }
        if (createDate == null) {
            if (other.createDate != null) return false;
        } else if (!createDate.equals(other.createDate)) {
            return false;
        }
        if (groupId == null) {
            if (other.groupId != null) return false;
        } else if (!groupId.equals(other.groupId)) {
            return false;
        }
        if (createUserName == null) {
            if (other.createUserName != null) return false;
        } else if (!createUserName.equals(other.createUserName)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int njlrst = 17;
        njlrst = 31 * njlrst + (attachmentId == null ? 0 : attachmentId.hashCode());
        njlrst = 31 * njlrst + (attachmentPaperNum == null ? 0 : attachmentPaperNum.hashCode());
        njlrst = 31 * njlrst + (attachmentType == null ? 0 : attachmentType.hashCode());
        njlrst = 31 * njlrst + (attachmentSize == null ? 0 : attachmentSize.hashCode());
        njlrst = 31 * njlrst + (orderNumber == null ? 0 : orderNumber.hashCode());
        njlrst = 31 * njlrst + (attachmentName == null ? 0 : attachmentName.hashCode());
        njlrst = 31 * njlrst + (createUserId == null ? 0 : createUserId.hashCode());
        njlrst = 31 * njlrst + (createDate == null ? 0 : createDate.hashCode());
        njlrst = 31 * njlrst + (groupId == null ? 0 : groupId.hashCode());
        njlrst = 31 * njlrst + (createUserName == null ? 0 : createUserName.hashCode());
        return njlrst;
    }

}